1. Field of the Invention
The present invention relates to a longest coincidence data detection, and more particularly to an apparatus and method for detecting a longest coincidence data between an external data externally supplied and an internal data internally stored.
2. Description of the Related Art
A longest coincidence data detecting apparatus compares an internal data internally stored with an external data externally supplied to detect the longest coincidence data between the internal data and the external data. The longest coincidence data detecting apparatus is conventionally composed of a single associative memory unit or a plurality of associative memory units which are connected in series. The comparison is performed to detect the longest coincidence data while the mask bits for the associative memory units in the whole apparatus are shifted one bit by one bit.
In this manner, in the conventional longest coincidence data detecting apparatus as mentioned above, it is necessary to perform the comparison while the mask bits for the associative memory units in the whole apparatus are shifted over all the bits. Therefore, the shifting operation and the comparing operation must be performed for the number of times which is equal to the number of mask bits. In this manner, there is a problem in that the operation speed becomes slow.
In Japanese Laid Open Patent Disclosure (JP-A-Showa 61-162898), an associative memory apparatus is described which includes a data memory, a counter for counting an address of the data memory, and a mechanism for comparing a search data and an output of the data memory and for stopping the counter when the comparing result indicates matching. In this reference, the associative memory apparatus is composed of a search data memory for storing a plurality of search data, a selecting means for selecting a specific one of the plurality of search data stored in the search data memory, the mechanism for comparing a portion of the selected search data in a specific comparison region and a portion of a data read out from the data memory corresponding to the comparison region for the selected search data, and for stopping the counter when the comparing result indicates coincidence, and another mechanism for restarting the counter from an address next to the stopped address.